from django.conf.urls.defaults import *
from django.conf import settings

from django.contrib import admin
admin.autodiscover()

from s_te.sitemap import *
from s_te.feeds import *

sitemaps = {'blog': BlogSitemap,
            'projects': ProjectSitemap,
            'technology': TechnologySitemap,
            'pages': PageSitemap,
            }

feeds = {
         'rss-latest': LatestEntries,
         'atom-latest': AtomLatestEntries, 
         'rss-categories': LatestEntriesByCategory,
         'atom-categories': AtomLatestEntriesByCategory, }

urlpatterns = patterns('',
    (r'^sitemap.xml$', 'django.contrib.sitemaps.views.sitemap', {'sitemaps': sitemaps}),
    (r'^feeds/(?P<url>.*)/$', 'django.contrib.syndication.views.feed', {'feed_dict': feeds}),
    (r'^blog/', include('bl_g.urls')),
    (r'^projects/', include('pr_j.urls')),
    (r'^portfolio/', include('arrt.urls')),
    (r'^contact/', include('c_ntact.urls')),
    (r'^technology/', include('t_ch.urls')), 
    (r'^testimonials/', include('endo.urls')), 
    (r'^tinymce/', include('tinymce.urls')),
    (r'^site-admin/blog/', include('bl_g.admin.urls')),
    (r'^site-admin/projects/', include('pr_j.admin.urls')),
    (r'^site-admin/blurb/', include('bl_rb.admin.urls')),
    (r'^site-admin/technology/', include('t_ch.admin.urls')),
    (r'^site-admin/xfn/', include('xfn.admin.urls')),
    (r'^site-admin/cms/', include('cm_s.admin.urls')),
    (r'^site-admin/testimonials/', include('endo.admin.urls')),
    (r'^site-admin/', include('s_te.admin.urls')),
    (r'^admin/', include(admin.site.urls)),
    (r'^', include('s_te.urls')),
    (r'^', include('cm_s.urls')),
    (r'^sentry/', include('sentry.urls')),
)


if settings.SERVE_MEDIA:
    urlpatterns += patterns('',
        (r'^media/(?P<path>.*)$', 'django.views.static.serve',
            {'document_root': settings.MEDIA_ROOT}),
        (r'^static/(?P<path>.*)$', 'django.views.static.serve',
            {'document_root': settings.STATIC_ROOT}),        
    )